package com.gxa.insurance.service;

import com.gxa.insurance.exception.BusinessException;
import com.gxa.insurance.pojo.Customer;
import io.swagger.models.auth.In;

import java.util.List;
import java.util.Map;

/**
 * @InterfaceName CustomerService
 * @Description TODO
 * @Author Oneby
 * @Date 2022/6/7 13:07
 * @Version 1.0
 */
public interface CustomerService {

    /**
     * 添加客户
     * @param customer
     * @throws Exception
     */
    void add(Customer customer) throws Exception;

    /**
     * 分页查询
     * @param page
     * @param size
     * @return
     * @throws Exception
     */
    Map<String,Object> selectByPage(Integer page, Integer size) throws Exception;

    /**
     * 更新客户
     * @param customer
     * @throws Exception
     */
    void update(Customer customer) throws Exception;

    /**
     * 根据id查询客户
     * @param id
     * @return
     * @throws Exception
     */
    Customer selectById(Integer id)throws Exception;

    /**
     * 模糊查询
     * @param map
     * @return
     * @throws Exception
     */
    Map<String,Object> selectLikeName(Map map) throws Exception;

    /**
     * 查询所有的Email
     * @return
     * @throws Exception
     */
    List<Customer> selectEmail() throws Exception;

    /**
     * 查询Email是否存在
     * @param email
     * @return
     * @throws Exception
     */
    boolean selectByEmail(String email)throws Exception;


    /**
     * 查询所有用户
     * @return
     */
    List<Customer> selectAll();

    /**
     * 顾客关联优惠券的方法
     * @param email
     * @return
     */
    Map<String,Object> selectByEmailAndCoupon(String email) throws Exception;

    /**
     * 前台通过手机号注册登录
     * @param phone
     * @return
     */
    Map<String,Object> Register(String phone);

    /**
     * 前台根据手机号查询客户
     * @param phone
     * @return
     * @throws Exception
     */
    Customer selectByPhone(String phone)throws Exception;
}
